package com.lzh.farmersshop.controller.admin;


import com.lzh.farmersshop.util.Result;
import lombok.extern.slf4j.Slf4j;
import com.lzh.farmersshop.entity.Orderdetails;
import com.lzh.farmersshop.service.OrderdetailsService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;

/**
 * (Orderdetails)表控制层
 *
 * @author makejava
 * @since 2024-01-04 15:41:51
 */
@Slf4j
@RestController
@RequestMapping("admin/orderdetails")
@Transactional(rollbackFor = Exception.class)
public class OrderdetailsController {
    /**
     * 服务对象
     */
    @Resource
    private OrderdetailsService orderdetailsService;

    /**
     * 分页查询所有数据
     *
     * @param orderdetails 查询实体
     * @return 所有数据
     */
    @GetMapping("selectAll")
    public Result selectAll(Orderdetails orderdetails,Integer page,Integer limit) {
        if (limit == null || page == null) {
            return Result.failure("limit和page不能为空");
        }
        return orderdetailsService.selectAll(orderdetails,page,limit);
    }


}

